﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManageMenu.aspx.cs" Inherits="admin_ManageMenu" MasterPageFile="~/admin/MasterPage2.master" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Conten1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<table cellpadding="0" cellspacing="0" bgcolor="white" width="1100px">
    <tr bgcolor="#FA7E02" class="letracuadroscolores">
        <td>Manage Menu</td>
    </tr>
</table>

<table width="1100px" bgcolor="white">
    <tr align="center">
        <td>
            <table width="350px" style=" margin-top:30px; margin-bottom:30px; box-shadow: 0 0 15px #000000">
                <tr>
                    <td>
                        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
                    </td>
                </tr>
                <tr align="left">
                    <td>
                        <asp:TreeView ID="arbol" runat="server" Width="320px">
                            <HoverNodeStyle Font-Bold="True" ForeColor="Blue" Font-Underline="False"></HoverNodeStyle>
                            <NodeStyle HorizontalPadding="0px" NodeSpacing="2px" VerticalPadding="1px" Font-Bold="False" Font-Names="Arial" Font-Size="13pt" ForeColor="Black"></NodeStyle>
                            <ParentNodeStyle Font-Bold="True"></ParentNodeStyle>
                            <RootNodeStyle Font-Bold="True" Font-Size="14pt"></RootNodeStyle>
                            <SelectedNodeStyle HorizontalPadding="0px" VerticalPadding="0px" BackColor="Black" Font-Underline="False" ForeColor="AliceBlue"></SelectedNodeStyle>
                        </asp:TreeView>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>
            </table>
        </td>
    </tr>
    <tr align="center">
        <td align="center">
            <table cellpadding="0" cellspacing="0" width="350px" style="margin-bottom:30px; box-shadow: 0 0 15px #000000; min-width:350px">
                <tr>
                    <td bgcolor="#FA7E02" colspan="2" style=" font-size:20px; font-family:Arial; text-align:center; color:White;"><strong>Edit Option</strong></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr align="left">
                    <td style="font-weight:bold; font-size:15px; font-family:Arial; padding-left:10px">Menu:</td>
                    <td><div>
                        <asp:DropDownList ID="cb_menu" runat="server" Width="204px" 
                            AutoPostBack="True" Height="22px" 
                            onselectedindexchanged="cb_menu_SelectedIndexChanged">
                        <asp:ListItem Value="2">Menu Internal</asp:ListItem>
                        <asp:ListItem Value="1">Menu External</asp:ListItem>
                        </asp:DropDownList></asp:AccessDataSource></div></td>
                    
                </tr>
                <tr align="left">
                    <td style="font-weight:bold; font-size:15px; font-family:Arial; padding-left:10px">Name:</td>
                    <td><div><asp:TextBox ID="tb_opcion" runat="server" Width="200px"></asp:TextBox></div></td>
                </tr>
                <tr align="left">
                    <td style="font-weight:bold; font-size:15px; font-family:Arial; padding-left:10px">Url:</td>
                    <td><div><asp:TextBox ID="tb_url" runat="server" Width="200px"></asp:TextBox></div></td>
                </tr>
                <tr align="left">
                    <td style="font-weight:bold; font-size:15px; font-family:Arial; padding-left:10px">
                        <asp:Label ID="lb_option" runat="server" Text="Option:" Visible="False"></asp:Label></td>
                    <td><div>
                        <asp:DropDownList ID="cb_option" runat="server" Width="204px" 
                            AutoPostBack="True" Height="22px" DataSourceID="SQLDS" 
                            DataTextField="opc_name" DataValueField="opc_id" Visible="False" ></asp:DropDownList></div></td>
                </tr>
                <tr align="left">
                    <td>&nbsp;</td>
                    <td><asp:CheckBox ID="chk_new" runat="server" Text="New Option" AutoPostBack="True" oncheckedchanged="chk_new_CheckedChanged" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label ID="l1" runat="server"></asp:Label>
                    <asp:Button ID="Button1" runat="server" Text="&lt;" onclick="Button1_Click" /><asp:Label
                        ID="lb_orden" runat="server" Text="0" Font-Bold="True" Font-Names="Arial" 
                            Font-Size="Large"></asp:Label>
                        <asp:Button ID="Button2" runat="server"
                            Text="&gt;" onclick="Button2_Click" />
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;<asp:SqlDataSource ID="SQLDS" runat="server" DataSourceMode="DataReader" 
                            ConnectionString="Data Source=.\SQLEXPRESS;Initial Catalog=usuarios;Integrated Security=True;Pooling=False" SelectCommand=" SELECT TOP(5) opc_name, opc_id FROM tbl_option WHERE opc_pagina = '19' ORDER BY opc_id desc"></asp:SqlDataSource></td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <table cellpadding="0" cellspacing="0">
                            <tr align="center">
                                <td align="center">
                                    <asp:LinkButton ID="lnk_cancel" runat="server" CssClass="button_save" 
                                        Visible="false" onclick="lnk_cancel_Click"><span>Cancel</span></asp:LinkButton>
                                    <asp:LinkButton ID="lnk_add" runat="server" CssClass="button_save" 
                                        Visible="false" onclick="lnk_add_Click"><span>Add</span></asp:LinkButton>
                                    <asp:LinkButton ID="lnk_delete" runat="server" CssClass="button_save" onclick="lnk_delete_Click" ><span>Delete</span></asp:LinkButton>
                                    <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText="Are you sure the option needs to be deleted?" Enabled="True" TargetControlID="lnk_delete"></asp:ConfirmButtonExtender>
                                    <asp:LinkButton ID="lnk_save" runat="server" CssClass="button_save" onclick="lnk_save_Click"><span>Save</span></asp:LinkButton>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    
</table>



<script type = "text/javascript">
    function OnLoad() {
        var links = document.getElementById("<%=arbol.ClientID %>").getElementsByTagName("a");
        /*for (var i = 0; i < links.length; i++) {
            links[i].setAttribute("href", "ManageMenu.aspx?=" + " javascript:NodeClick(\"" + links[i].id + "\", \"" + links[i].getAttribute("href") + "\")");
        }*/
    }
    window.onload = OnLoad;
    function NodeClick(id, attribute) {
        var nodeLink = document.getElementById(id);
        //alert(nodeLink.innerHTML + " clicked");
        return nodeLink.innerHTML;
        eval(attribute);
    }
</script>

</asp:Content>

